/**
 * 
 */
package com.ginger;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.security.core.Authentication;
import org.springframework.security.oauth2.config.annotation.web.configuration.EnableResourceServer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 资源服务启动类
 * @author 姜锋
 * @date 2018年12月20日 下午8:03:14
 * @version V1.0
 */
@SpringBootApplication
@EnableResourceServer
@RestController
public class GingerResourceApplication {
	
	private   Logger log = LoggerFactory.getLogger(getClass());

	public static void main(String[] args) {
		new SpringApplicationBuilder(GingerResourceApplication.class).run(args);
	}
	// 添加一个测试访问接口
	@GetMapping("/user")
	public Authentication getUser(Authentication authentication) {
		log.info("resource: user {}", authentication);
		return authentication;
	}
}
